template "Boot Sector FAT32"

// Template by Stefan Fleischmann
// To be applied to sector 0 of a FAT32-formatted logical drive.

description "BIOS parameter block (BPB) and more"
applies_to disk
sector-aligned

requires 0x02	"90"
requires 0x52	"46 41 54 33 32" // ="FAT32" at offset 52
requires 0x1FE "55 AA"

begin
	read-only hex 3 "JMP "
	char[8]	"OEM"

	section	"  BIOS"
	uint16	"  "
	uint8		"  "
	uint16	" "
	uint8		" FAT"
	uint16	"   .(.)"
	uint16	" (  )"
	hex 1		"  (hex)"
	uint16	"  FAT"
	uint16	"  "
	uint16	""
	uint32	" "
	uint32	" (  )"
	
	section	" FAT32"
	uint32	"  FAT"
	uint16	""
	uint16	""
	uint32	"1-   ."
	uint16	"FSInfo "
	uint16	" . "
	read-only hex 12 "()"
	endsection
	
	hex 1		"BIOS  (hex, HD=8x)"
	read-only uint8 "( )"
	hex 1		".   (29h)"
	uint32	"   ("
	move -4
	hex 4		"   (hex)"
	char[11] " "
	char[8]	" "
	endsection

	goto		0x1FE
	read-only hex 2 " (55 AA)"
end